<?php
    $a = mysqli_connect("localhost","root","gala123456");
    $db = mysqli_select_db($a,"sheep");
    $sql = "SELECT * FROM `orders`";
    $query = mysqli_query($a,$sql);
    $ji = 0;
    while($row4 = mysqli_fetch_row($query4)){
        $ji++;
    }
    $sql1 = "INSERT INTO `orders`(`order_id`, `openid`, `sheep_id`, `date`, `state`) VALUES 
    ('$ji','".$_GET["openid"]."','".$_GET["id"]."','".date("Y-m-d")."','待签约')";
    $query1 = mysqli_query($a,$sql1);
?>